package com.mi.soul.windows.util.project;

/**
 * 服务端消息返回对象
 *
 * @author 王永吉
 */
enum ResponseMsg implements MiResponseMessage {

    //系统已经使用的Code
    SUCCESS_200(200, "操作完成"),

    ERROR_400(400, "请求参数错误"),
    ERROR_401(401, "身份认证失败"),
    ERROR_402(402, "权限不足无法访问"),
    ERROR_404(404, "请求资源不存在"),

    ERROR_500(500, "操作失败"),
    ERROR_TIME_OUT_500(500, "连接超时，请检查网络环境"),
    ERROR_SERVER_503(503, "服务器目前无法使用"),
    ERROR_OUT_555(555, "强制退出"),

    RE_SUBMIT_600(600, "重复提交");

    private final Integer code;
    private final String message;

    ResponseMsg(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public String toString() {
        return "{" +
                "  \"code\": " + code +
                "  \"message\": " + message +
                "}";
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
